package com.stool.nettyupload.utils;

import com.alibaba.fastjson.JSON;
import com.stool.nettyupload.pojo.JsonResponse;

public class JsonUtils {

    public static String toJson(Object o) {
        return JSON.toJSONString(o);
    }

    public static String okJson(Object data) {
        return JSON.toJSONString(JsonResponse.ok(data));
    }

    public static String errorJson(String msg) {
        return JSON.toJSONString(JsonResponse.error(msg));
    }
}
